<?php
if(have_posts())
{
	//$image_rs = new SimpleImage();
	while (have_posts())
	{
		the_post();
		$postID = get_the_ID();
		$title = get_the_title($postID);
		$perlink = get_permalink($postID);
		
		$alt = db_get_alt_attachment_id($postID, $wpdb->prefix.'thumbnail');
		if(!$alt)
			$alt = db_vietnamese_slug($title);
		$thumbnail = db_get_post_meta($postID, $wpdb->prefix.'thumbnail');
		//if($thumbnail)
			//$thumbnail = db_resizeImage($image_rs, $thumbnail, 149, 79);
		$price = get_post_meta($postID,$wpdb->prefix.'price',true);
		$location = get_post_meta($postID, $wpdb->prefix.'location',true);
		$lenght_of_stay = get_post_meta($postID, $wpdb->prefix.'lenght_of_stay',true);
		$html.='		
		<li>
             <div class="box-img">
             <a title="'.$title.'" href="'.$perlink.'">
               <img style="padding: 0"  alt="'.$alt.'" src="'.$thumbnail.'" />
              </a> 
              </div>
              <div class="box-info">                                    
                <div class="details-info">
                   <a href="'.$perlink.'" class="name" title="'.$title.'">'.db_shortDesc($title,30).'</a>
                   <span class="price">Price: '.$price.' USD</span>
                   <span class="note">'.$lenght_of_stay.'</span>
               	</div>
               </div>
        </li>';		
	}
	//wp_reset_query();
	//unset($image_rs);
}
else 
{
	$html.='<li>No tour!.</li>';
}